<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});
//登录
$router->post('adminlogin', 'Account\AdminController@login');

//测试员工认证路由   加登录中间件
$router->group(['middleware' => 'admin'], function () use ($router) {
    $router->get('/admin', 'Account\AdminController@admin');
});

//上传图片  文件 单图
$router->post('photo', 'UploadImgController@UploadPic');


/**
 * 定时任务
 */
$router->group(['namespace' => 'Task', 'prefix' => 'task', 'middleware' => 'task.token'], function () use ($router) {

    //更新中介公司  过期未续费的账号状态
    $router->get('updateaccount', 'ExpiredAccountController@updateAccount');

    //自动更新中介公司设置的自动转房客规则
    $router->get('autoupdatestatus', 'ExpiredAccountController@autoUpdateStatus');

    //删除三个月之前的日志操作记录
    $router->get('dellog', 'ExpiredAccountController@delLog');

    //公司房客更新规则状态更新《没有用》
    $router->get('updatestatus', 'UpdateMoveRuleController@updateStatus');

    //测试添加数据
    $router->get('adddata', 'UpdateMoveRuleController@addData');
});


//平台内部用户
$router->group(['middleware' => 'admin','namespace' => 'Account', 'prefix' => 'account'], function () use ($router) {
    //用户列表
    $router->get('adminlist', 'AdminController@adminList');

    //添加用户
    $router->post('adminadd', 'AdminController@adminAdd');

    //修改用户
    $router->post('adminedit', 'AdminController@adminEdit');

    //禁用用户
    $router->post('updatestatus', 'AdminController@updateStatus');

    //修改密码
    $router->post('updatepass', 'AdminController@updatePass');

});


$router->group(['middleware' => 'admin','namespace' => 'Account', 'prefix' => 'article'], function () use ($router) {
    //文章列表
    $router->get('list', 'ArticleController@articleList');

    //添加文章
    $router->post('add', 'ArticleController@add');

    //修改文章
    $router->post('edit', 'ArticleController@edit');

    //删除文章
    $router->post('del', 'ArticleController@articleDel');

    //启用、禁用文章
    $router->post('updatestatus', 'ArticleController@updateStatus');

});


//创建分布式表
$router->group(['middleware' => 'admin','namespace' => 'Account', 'prefix' => 'createtable'], function () use ($router) {
    //获取中介公司所有系列表存在的状态
    $router->get('gettablestatus', 'CreateTableController@getTableStatus');

    //员工业绩统计表
    $router->get('createachievement', 'CreateTableController@createAchievement');

    //合同表
    $router->get('createcontract', 'CreateTableController@createContract');

    //合同诚意金表 contract_earnest_money
    $router->get('createcem', 'CreateTableController@createCEM');

    //规则表 conversion_rules
    $router->get('createconversionrules', 'CreateTableController@createConversionRules');

    //客源跟进记录表 customer_follow
    $router->get('createcustomerfollow', 'CreateTableController@createCustomerFollow');

    //客源/房源跟进记录提醒表 h_customer_follow_source
    $router->get('createcfs', 'CreateTableController@createCFS');

    //创建客源表
    $router->get('createcustomers', 'CreateTableController@createCustomers');

    //房源跟进表 follow
    $router->get('createfollow', 'CreateTableController@createFollow');

    //操作日志表 log
    $router->get('createlog', 'CreateTableController@createLog');

    //手机端 工作计划表 mobile_plan
    $router->get('createmobileplan', 'CreateTableController@createMobilePlan');

    //公司房客自动转移规则表 move_rule
    $router->get('createmoverule', 'CreateTableController@createMoveRule');

    //公司规则状态更新表 move_rule_status
    $router->get('createrulestatus', 'CreateTableController@createRuleStatus');

    //新闻公告表 news
    $router->get('createnews', 'CreateTableController@createNews');

    //房图片 room_img_url
    $router->get('createimgurl', 'CreateTableController@createImgUrl');

    //房子信息表 room_info
    $router->get('createroominfo', 'CreateTableController@createRoomInfo');

    //楼盘字典表 room_wordbook
    $router->get('createroomwordbook', 'CreateTableController@createWordBook');

    //楼盘字典对应的栋座详细信息表 room_wordbook_info
    $router->get('createroomwordbookinfo', 'CreateTableController@createWordBookInfo');

    //员工考勤表 staff_attendance
    $router->get('createstaffattendance', 'CreateTableController@createStaffAttendance');

    //公司内部员工论坛表 staff_forum
    $router->get('createstaffforum', 'CreateTableController@createStaffForum');

    //内部员工评论表 staff_forum_comment
    $router->get('createstaffforumcomment', 'CreateTableController@createStaffForumComment');

    //中介公司员工 工作总结表 work_summary
    $router->get('createworksummary', 'CreateTableController@createWorkSummary');
});


//平台创建账号给中介公司
$router->group(['middleware' => 'admin','namespace' => 'Account', 'prefix' => 'account'], function () use ($router) {

    //中介公司管理账号列表
    $router->get('list', 'AdministrationController@listAdmin');

    //添加中介公司管理账号
    $router->post('add', 'AdministrationController@addAdmin');//添加成功以后该账号还是不能直接使用的  需要把一系列表创建完成 并审核通过以后才能正常使用

    //修改中介公司管理账号
    $router->post('edit', 'AdministrationController@editAdmin');

    //删除图片(修改删除)
    $router->post('delimage', 'AdministrationController@delImage');

    //删除图片（添加删除）
    $router->post('delqiniuimg', 'AdministrationController@delQiniuImg');

    //审核中介公司账号
    $router->get('examineaccount', 'AdministrationController@examineAccount');

    //修改中介公司账号的状态（审核   禁用启用 没有权利手动修改中介公司的账号状态  ）
//    $router->get('updatecompanystatus', 'AdministrationController@updateCompanyStatus');

    //中介公司缴费记录列表
    $router->get('getpaylist', 'AdministrationController@getPayList');

    //提交中介公司的续费  等待审核
    $router->post('pay', 'AdministrationController@pay');

    //审核中介公司的续费
    $router->get('examinerenew', 'AdministrationController@examineRenew');

    //账号等级列表
    $router->get('memberlist', 'AdministrationController@memberList');

    //分类列表
    $router->get('typelist', 'TypeController@typeList');

    //添加分类
    $router->post('typeadd', 'TypeController@typeAdd');

    //修改分类
    $router->post('typeedit', 'TypeController@typeEdit');

    //删除分类
    $router->post('typedel', 'TypeController@typeDel');

    //获取所有分类
    $router->get('getalltype', 'TypeController@getAllType');

    //分类状态列表
    $router->get('typedetaillist', 'TypeDetailController@typeDetailList');

    //添加分类状态
    $router->post('typedetailadd', 'TypeDetailController@typeDetailAdd');

    //修改分类状态
    $router->post('typedetailedit', 'TypeDetailController@typeDetailEdit');

    //删除分类状态
    $router->post('typedetaildel', 'TypeDetailController@typeDetailDel');

});

/**
 * 系统配置的房客源 下所有的分类
 */
$router->group(['middleware' => 'admin','namespace' => 'Account', 'prefix' => 'system'], function () use ($router) {

    //列表
    $router->get('list', 'SystemTypeController@listType');

    //添加
    $router->post('add', 'SystemTypeController@addType');

    //修改
    $router->post('edit', 'SystemTypeController@editType');

    //删除
    $router->get('del', 'SystemTypeController@delType');

});

/**
 * 模块及权限
 */
$router->group(['middleware' => 'admin','prefix' => 'core', 'namespace' => 'Core'], function () use ($router){
//  模块增删改查
    $router->post('module/add', 'ModuleController@addModule');//添加
    $router->post('module/delete', 'ModuleController@deleteModule');//删除模块
    $router->post('module/edit', 'ModuleController@editModule');//修改
    $router->get('module/one', 'ModuleController@oneModule');//根据ID 查询该模块的详情《用不上》
    $router->get('module/list', 'ModuleController@getModuleList');//模块的列表

//  权限增删改查
    $router->post('authority/add', 'AuthorityController@addAuthority');//添加
    $router->post('authority/delete', 'AuthorityController@deleteAuthority');//删除
    $router->post('authority/edit', 'AuthorityController@editAuthority');//修改
    $router->get('authority/one', 'AuthorityController@oneAuthority');//根据ID 权限的详情《用不上》
    $router->get('authority/list', 'AuthorityController@getAuthorityList');//权限的列表

    $router->get('authority/allofmodule', 'AuthorityController@getAuthoritiesAllOfModule'); // 二叉树结构 [ {module:'', authorities:[{...},{...} ...] } ]


    //房源权限页面
    $router->get('roompermissionpage', 'AuthorityController@roomPermissionPage');

    //客源权限页面
    $router->get('customerspermissionpage', 'AuthorityController@customersPermissionPage');

    //其他权限页面
    $router->get('otherpermissionpage', 'AuthorityController@otherPermissionPage');

});


//======================================================================================================================
//=================================================中介公司相关路由=====================================================
//======================================================================================================================
$router->post('login', 'Backstage\LoginController@index');

//测试用户认证路由   加登录中间件
$router->group(['middleware' => 'auth'], function () use ($router) {
    $router->get('/auth', 'Backstage\UserController@user');
});

//三级联动
$router->get('area', 'Backstage\AreaController@listArea');

$router->get('city', 'Backstage\AreaController@getCity');

/**
 * 客源管理
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'customers'], function () use ($router) {
    //打开客源列表的时候   获取类型值
    $router->get('getlisttype','CustomersController@getListType');

    //新增客源时获取类型
    $router->get('getdefaulttype', 'CustomersController@getDefaultType');

    //客源列表
    $router->get('list', 'CustomersController@listCustomers');

    //客源列表快速预览信息
    //$router->get('quickpreview','CustomersController@customerQuickPreview');

    //客源所有跟进列表
    $router->get('followlists','CustomerFollowController@customerFollowlist');

    //获取跟进内容
    $router->get('follow','CustomersController@customerFollow');

    //点击编辑客源时 智能匹配房源
    $router->post('recommend','CustomersController@customersRecommendRoom');

    //添加修改 客源录入手机号时验证手机号是否存在
    $router->get('repeat', 'CustomersController@repeatAddition');

    //添加客源信息
    $router->post('add', 'CustomersController@addCustomers');

    //修改客源信息
    $router->post('update', 'CustomersController@updatecustomers');

    //客源信息放到回收站与恢复
    $router->post('recyclebin', 'CustomersController@recycleBin');

    //删除客源信息
    $router->post('del', 'CustomersController@del');

    //回收站的客源信息列表
    $router->get('recyclebininfo', 'CustomersController@recycleBinInfo');

    //用户添加客源跟进
    $router->post('addfollow', 'CustomerFollowController@addCustomerFollow');

    //修改客源跟进
    $router->post('updatefollow', 'CustomerFollowController@updateCustomerFollow');

    //删除客源跟进
    $router->post('delfollow','CustomerFollowController@delCustomerFollow');

    //用户修改客源状态和分配业绩
    $router->post('addcustomersachievement','CustomersController@addAchievement');

    //获取房源  客源里面所有能用到的类型种类
    //$router->get('getalltypedetail', 'CustomersController@getAllTypeDetail');

    //根据客源id查询详情
    $router->get('detail','CustomersController@detail');
});


/**
 * 房源管理
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'room'], function () use ($router) {
    //房客源提醒 默认数据
    $router->get('roomcustomerdefaultdata','RoomInfoController@RoomCustomerDefaultData');

    //打开房源列表的时候   获取类型值
    $router->get('getlisttype','RoomInfoController@getListType');

    //房源列表
    $router->get('list', 'RoomInfoController@houseList');

    //打开新增房源的页面  获取的类型值
    $router->get('getdefaulttype','RoomInfoController@getDefaultType');

    //添加房源之前根据房源的楼盘字典  栋座  位置、 等 查询该房源是不是重复录入
    $router->get('checkhouse','RoomInfoController@checkHouse');

    //增加房源
    $router->post('inserthouse','RoomInfoController@insertHouse');

    //点击编辑房源的按钮  匹配客源的信息  matchCustomerInfo
    $router->get('matchcustomerinfo','RoomInfoController@matchCustomerInfo');

    //修改房源
    $router->post('updatahouse','RoomInfoController@updataHouse');

    //用户修改房源状态和分配业绩
    $router->post('addachievement','RoomInfoController@addAchievement');

    //房源回收站列表
    $router->get('recyclebinlists','RoomInfoController@roomRecyclebinLists');

    //删除房源到回收站
    $router->post('softdel','RoomInfoController@softDelHouse');

    //删除房源
    $router->post('delhouse','RoomInfoController@DelHouse');

    //用户添加房源跟进
    $router->post('roomfollow','RoomFollowController@addRoomFollow');

    //修改房源跟进
    $router->post('updatefollow','RoomFollowController@updateRoomFollow');

    //删除房源跟进
    $router->post('delfollow','RoomFollowController@delRoomFollow');

    //获取跟进列表
    $router->get('getfollow','RoomFollowController@getRoomFollow');

    //交易合同    诚意金  等快速查找房源列表接口
    $router->get('fastlist', 'RoomInfoController@houseListFast');

    //验证有没有重复的业主联系方式
    $router->get('verificationphone','RoomInfoController@verificationPhone');

    //获取所有房源的跟进列表  getAllFollow
    $router->get('getallfollow','RoomInfoController@getAllFollow');

    //根据房源id查询详情
    $router->get('detail','RoomInfoController@detail');

    //图片列表
    $router->get('imageslists','RoomInfoController@ImagesLists');

    //多图上传带水印
    $router->post('uploadimg','RoomInfoController@UploadFiles');

    //删除图片
    $router->post('delimg','RoomInfoController@delimg');
});

/**
 * 楼盘字典管理
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'wordbook'], function () use ($router) {

    //楼盘字典添加页下拉框数据
    $router->get('datawordbook','RoomWordbookController@wordType');

    //添加楼盘字典
    $router->post('addwordbook','RoomWordbookController@insertBook');

    //删除楼盘字典
    $router->get('delwordbook','RoomWordbookController@delBook');//ok

    //回收站的楼盘字典列表
    $router->get('recyclebinwordbook','RoomWordbookController@RecycleBinWordbookList');//...

    //修改楼盘字典
    $router->post('savewordbook','RoomWordbookController@saveBook');

    //查询楼盘字典
    $router->get('listwordbook','RoomWordbookController@listBook');

    //栋座添加时下拉框类型数据
    $router->get('wordbooktype','RoomWordbookController@wordBookType');

    //添加楼盘字典 - 栋座信息
    $router->post('addbuilding','RoomWordbookController@addBuilding');

    //批量添加楼盘字典 -栋座信息
    $router->post('batchaddbuilding','RoomWordbookController@batchAddBuilding');

    //修改楼盘字典 - 栋座信息
    $router->post('savebuilding','RoomWordbookController@saveBuilding');

    //删除楼盘字典 - 栋座信息  逻辑删除
    $router->get('delbuilding','RoomWordbookController@delBuilding');//ok

    //查询楼盘字典 - 栋座信息
    $router->get('listbuilding','RoomWordbookController@listBuilding');

    //添加房源时搜索楼盘字典
    $router->get('searchwordbook','RoomWordbookController@searchBook');

    //添加房源是根据楼盘字典获取该楼盘下面的栋座
    $router->get('getbuilding','RoomWordbookController@getBuilding');

    //添加房源时根据栋座的名称获取该栋座下的所有位置信息
    $router->get('getposition','RoomWordbookController@getPosition');

    //根据楼盘字典的名字 准确获取楼盘字典的ID
    $router->get('getbookid','RoomWordbookController@getBookId');

    //回收站删除楼盘字典（这里只做软删除）
    $router->get('delrecyclebook','RoomWordbookController@delRecycleBook');

});


/**
 * 部门管理
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'department'], function () use ($router) {
    //获取系统管理组的信息
    $router->get('info', 'DepartmentController@getSystemInfo');

    //获取部门信息列表
    $router->get('list', 'DepartmentController@getDepartmentList');

    //添加部门信息
    $router->post('add', 'DepartmentController@addDepartment');

    //修改部门信息
    $router->post('edit', 'DepartmentController@editDepartment');

    //删除部门信息  回收站还原部门信息
    $router->post('del', 'DepartmentController@delDepartment');

    //回收站彻底删除部门
    $router->post('recycledel', 'DepartmentController@recycleDelDepartment');

    //部门回收站列表
    $router->get('recycle', 'DepartmentController@RecycleList');

    //修改部门的权限
    $router->post('editdepartmentpermission', 'DepartmentController@editDepartmentPermission');

    //修改了部门权限以后   在批量修改该部门下面所有员工的权限
    $router->get('editdepartmentdownuserpermission', 'DepartmentController@editDepartmentDownUserPermission');

    /**
     *公用检索条件下拉框    部门的下拉框
     */
    $router->get('dropdown', 'DepartmentController@dropdown');//部门的下拉框
    $router->get('userdropdown', 'DepartmentController@userDropdown');//员工的下拉框

});
/**
 * 用户管理
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'user'], function () use ($router) {

    //获取用户信息列表
    $router->get('list', 'UserController@getUserList');

    //添加用户之前获取职务的下拉框
    $router->get('getpositionlist', 'UserController@getPositionList');

    //添加用户信息
    $router->post('add', 'UserController@addUser');

    //修改用户信息
    $router->post('save', 'UserController@saveUser');

    //删除图片(修改删除)
    $router->post('delimage', 'UserController@delImage');

    //删除图片（添加删除）
//    $router->post('delqiniuimg', 'UserController@delQiniuImg');

    //软删除用户信息
    $router->post('del', 'UserController@delUser');

    //硬删除用户
    $router->post('deletepermanently', 'UserController@DeletePermanently');

    //用户信息回收站列表
    $router->get('recyclebinuser', 'UserController@RecycleBinUserList');

    //上级领导重置员工的密码
    $router->get('resetpassword', 'UserController@resetPassword');

    //员工自己修改自己的密码
    $router->post('updatepassword', 'UserController@updatePassword');

    //查看当前登录员工  业务提醒
    $router->get('businessreminder', 'UserController@BusinessReminder');

    //业务处理
    $router->post('businessprocessing', 'UserController@BusinessProcessing');

    //房客id 获取跟进与提醒
    $router->post('roomcustomersfollow', 'UserController@getRoomCustomersRemind');

    //修改员工的权限
    $router->post('edituserpermission', 'UserController@editUserPermission');
});
/**
 * 用户打卡签到d
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'signin'], function () use ($router) {
    //获取打卡类型
    $router->get('getsignintype','SigninController@getSigninType');

    //上班打卡
    $router->get('gotowork', 'SigninController@goToWork');

    //下班打卡
    $router->get('afterwork', 'SigninController@afterWork');

    //签到详情列表
    $router->get('rankings', 'SigninController@Rankings');

});

/**
 * 模块及权限
 */
$router->group(['middleware' => 'auth', 'prefix' => 'core', 'namespace' => 'Core'], function () use ($router){
//  模块增删改查
//    $router->post('module/add', 'ModuleController@addModule');
//    $router->post('module/delete', 'ModuleController@deleteModule');
//    $router->post('module/edit', 'ModuleController@editModule');
//    $router->get('module/one', 'ModuleController@oneModule');
//    $router->get('module/list', 'ModuleController@getModuleList');
//
////  权限增删改查
//    $router->post('authority/add', 'AuthorityController@addAuthority');
//    $router->post('authority/delete', 'AuthorityController@deleteAuthority');
//    $router->post('authority/edit', 'AuthorityController@editAuthority');
//    $router->get('authority/one', 'AuthorityController@oneAuthority');
//    $router->get('authority/list', 'AuthorityController@getAuthorityList');

    $router->get('authority/allofmodule', 'AuthorityController@getAuthoritiesAllOfModule');

//  给用户授权
    $router->get('authority/edituser', 'AuthorityUsageController@saveUserAuthority');

//  给职务授权
    $router->get('authority/editduty', 'AuthorityUsageController@saveDutyAuthority');

    //权限页面 nm_permissions_type 传1房源权限页面  传2客源权限页面   传3其他权限页面
    $router->get('permissionpage', 'AuthorityController@PermissionPage');
});

/**
 * 数据统计
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'statistics'], function () use ($router) {

    //业绩排行
    $router->get('achievementlist', 'AchievementController@getAchievementList');

    //员工房源排行
    $router->get('roomachievementlist', 'AchievementController@getRoomInfoAchievementList');

    //员工客源排行
    $router->get('customerachievementlist', 'AchievementController@getCustomerInfoAchievementList');

    //员工房源跟进排行
    $router->get('roomfollownum', 'AchievementController@getRoomFollowNum');

    //员工客源跟进排行
    $router->get('customersfollownum', 'AchievementController@getCustomersFollowNum');
});
/**
 * 合同模块
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'contract'], function () use ($router) {

    // 合同列表
    $router->get('list', 'ContractController@lists');

    //添加合同
    $router->post('add', 'ContractController@add');

    //修改合同
    $router->post('edit', 'ContractController@edit');

    //删除合同软删除
    $router->post('delete', 'ContractController@delete');

    //合同回收站列表
    $router->get('recycle', 'ContractController@RecycleList');
});

/**
 * 诚意金模块
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'earnest'], function () use ($router) {

    //添加诚意金下拉框动态数据
    $router->get('datalist', 'ContractEarnestMoneyController@dataList');

    //诚意金列表
    $router->get('list', 'ContractEarnestMoneyController@listEarnest');

    //添加诚意金
    $router->post('add', 'ContractEarnestMoneyController@addEarnest');

    //修改诚意金
    $router->post('edit', 'ContractEarnestMoneyController@editEarnest');

    //删除诚意金
    $router->get('delete', 'ContractEarnestMoneyController@delEarnest');
});

/**
 * 工作总结
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'work'], function () use ($router) {

    //工作总结列表
    $router->get('list', 'WorkSummaryController@workList');

    //点击新增工作总结的页面
    $router->get('page', 'WorkSummaryController@workAddPage');

    //添加工作总结
    $router->post('add', 'WorkSummaryController@workAdd');

    //修改工作总结
    $router->post('edit', 'WorkSummaryController@editAdd');

    //删除工作总结到回收站 从回收站还原工作总结的信息
    $router->get('soft', 'WorkSummaryController@softDel');

    //从回收站删除工作总结《彻底删除》
    $router->get('hard', 'WorkSummaryController@hardDel');

    //经理点评
    $router->post('managerreview', 'WorkSummaryController@managerReview');

    //回收站工作总结的列表
    $router->get('recyclebinlist', 'WorkSummaryController@recycleBinList');
});
/**
 * 公司房客自动转移规则模块
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'moverule'], function () use ($router) {

    //添加自动转移规则下拉框动态数据
    $router->get('datalist', 'MoveRuleController@dataList');

    // 自动转移规则列表
    $router->get('list', 'MoveRuleController@lists');

    //添加自动转移规则
    $router->post('add', 'MoveRuleController@addRule');

    //修改自动转移规则
    $router->post('edit', 'MoveRuleController@editRule');

    //删除自动转移规则
    $router->post('delete', 'MoveRuleController@delRule');

    //立即执行所有开启规则
    $router->post('executionrule','MoveRuleController@ExecutionRule');

    //手动执行某一个规则=================这个方法前台没有调用===================
    $router->get('save', 'MoveRuleController@immediateSave');

    //员工转房客
    $router->post('moves', 'MoveRuleController@moves');

    //转出类目数据
    $router->get('movedata', 'MoveRuleController@moveData');

    //员工公私盘 公私客相互转换页面下拉数据
    $router->get('turndata', 'MoveRuleController@turnData');

    //员工公私盘 公私客相互转换
    $router->post('turns', 'MoveRuleController@turns');
});

/**
 * 职务模块
 */
$router->group(['middleware' => 'auth','namespace' => 'Backstage', 'prefix' => 'position'], function () use ($router) {

    // 职务列表
    $router->get('list', 'PositionController@listPosition');

    //添加职务
    $router->post('add', 'PositionController@addPosition');

    //修改职务
    $router->post('edit', 'PositionController@editPosition');

    //删除职务
    $router->get('delete', 'PositionController@delPosition');

    //修改了职务权限以后   在批量修改该职务下面所有员工的权限
    $router->get('editpositiondownuserpermission', 'PositionController@editPositionDownUserPermission');
});

//获取Redis里面的下拉框
$router->group(['middleware'=>'auth','prefix' => 'systemtype', 'namespace' => 'Account'], function () use ($router) {

    $router->get('getdropdownbox', 'SystemTypeController@getDropDownBox');
});

//操作日志
$router->group(['middleware'=>'auth','namespace' => 'Backstage','prefix' => 'log' ], function () use ($router) {

    $router->get('list', 'LogController@logList');
});

/**
 * ================================================================================================================
 * ========================================       APP接口          ================================================
 * ================================================================================================================
 */
//移动端登录
$router->post('applogin', 'Mobile\LoginController@appLogin');


//移动端计划任务
$router->group(['middleware'=>'apptoken','namespace'=>'Mobile','prefix'=>'mobile'],function () use ($router){
    //首页 检索框 CustomerAndRoomController
    $router->get('list', 'CustomerAndRoomController@dataList');

    //首页 查看任务模块
    $router->get('taskmodule','PlanTaskController@taskModule');

    //添加  修改 计划任务
    $router->post('addtask','PlanTaskController@addtask');

    //计划任务列表
    $router->get('plantasklist', 'PlanTaskController@plantasklist');

    //删除计划任务
    $router->get('delplantask', 'PlanTaskController@delplantask');
});

$router->group(['middleware'=>'apptoken','namespace'=>'Mobile','prefix'=>'mobile'],function () use ($router){

    //个人信息
    $router->get('personalinfo','PersonalController@personalInfo');

    $router->post('personalavatar','PersonalController@personalAvatar');//上传个人头像

});

//Help
$router->group(['middleware'=>'apptoken', 'namespace'=>'Help','prefix'=>'help'],function () use ($router){
    //新闻列表
    $router->get('newslist','HelpController@newsList');

    //公司介绍
    $router->get('companyinfo','HelpController@companyInfo');

    //使用说明
    $router->get('usehelp','HelpController@useHelp');

});

//客源公用
$router->group(['middleware'=>'apptoken','namespace'=>'Backstage','prefix'=>'appcustomer'],function () use ($router) {

    //客源 加载类型
    $router->get('getdefaulttype', 'CustomersController@getDefaultType');

    //添加修改 客源录入手机号时验证手机号是否存在
//    $router->get('repeat', 'CustomersController@repeatAddition');

});

//移动端   客源  -----私有
$router->group(['middleware'=>'apptoken','namespace'=>'Mobile\Customer','prefix'=>'appcustomer'],function () use ($router){

    //添加客源信息
    $router->post('add', 'CustomersController@addCustomers');

    //客源列表
    $router->get('list', 'CustomersController@appListCustomers');

    //用户添加客源跟进
    $router->post('addfollow', 'CustomersController@addCustomerFollow');

    //根据客源ID 获取该客源的跟进内容
    $router->get('follow','CustomersController@customerFollow');

    //添加修改 客源录入手机号时验证手机号是否存在
    $router->get('repeat', 'CustomersController@repeatAddition');

    //公客  写完跟进以后  根据客源的ID 从后台查询出该客源的重要信息
    $router->get('getdata', 'CustomersController@getCustomersData');

});




//房源  公用
$router->group(['middleware'=>'apptoken','namespace'=>'Backstage','prefix'=>'approom'],function () use ($router){

    //房源  加载 类型值
    $router->get('getdefaulttype','RoomInfoController@getDefaultType');

    //添加房源时搜索楼盘字典
    $router->get('searchwordbook','RoomWordbookController@searchBook');

    //添加房源是根据楼盘字典获取该楼盘下面的栋座
    $router->get('getbuilding','RoomWordbookController@getBuilding');

    //添加房源时根据栋座的名称获取该栋座下的所有位置信息
    $router->get('getposition','RoomWordbookController@getPosition');

//    //添加房源之前根据房源的楼盘字典  栋座  位置、 等 查询该房源是不是重复录入
//    $router->get('checkhouse','RoomInfoController@checkHouse');

    //APP上传房源图片
//    $router->post('uploadpic','RoomInfoController@UploadPic');//单图上传《暂时 没有用到》
    $router->post('uploadimg','RoomInfoController@UploadImg');//多图上传<APP端私有>


});

//移动端   房源操作----私有
$router->group(['middleware'=>'apptoken','namespace'=>'Mobile\Room','prefix'=>'approom'],function () use ($router){
    //房源列表
    $router->get('list', 'RoomController@AppRoomList');

    //根据房源ID 获取跟进列表
    $router->get('getfollow','RoomController@getRoomFollow');

    //增加房源
    $router->post('addroom','RoomController@addRoom');

    //用户添加房源跟进
    $router->post('addfollow', 'RoomController@addFollow');

    //添加房源之前根据房源的楼盘字典  栋座  位置、 等 查询该房源是不是重复录入
    $router->get('checkhouse','RoomController@checkHouse');

    //公盘  写完跟进以后  根据房源的ID 从后台查询出该房源的重要信息
    $router->get('getdata','RoomController@getData');

    //图片列表
    $router->get('imageslists','RoomController@ImagesLists');

});
